package essential.ch4;

/**
 * @Date 2021/10/23
 * @Created by Jonathan
 */
public class MainInvocation {
    private static boolean hasInit = false;
    private static int i;

    public static void main(String[] args) {
        //System.out.println(Arrays.toString(args));
        init(args.length - 1);
        if (i > 0) {
            print(args);
        }
    }

    public static void print(String[] s) {
        System.out.println(s[i--]);
        main(s);
    }

    public static void init(int value) {
        if (!hasInit) {
            hasInit = true;
            i = value;
        }
    }
}
